package com.ncwu.infrastructure.shirotoken;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.shiro.authc.UsernamePasswordToken;

/**
 * @author lixiao
 * @date 2019/7/31 20:54
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class CustomizedToken extends UsernamePasswordToken {

    /**
     * 登录类型
     */
    public String loginType;

    /**
     * 验证码
     */
    public String code;

    public CustomizedToken(final String username, final String password, final String loginType) {
        super(username, password);
        this.loginType = loginType;
    }

    public CustomizedToken(final String username, final String password,final String code, final String loginType) {
        super(username, password);
        this.loginType = loginType;
        this.code = code;
    }

    @Override
    public String toString(){
        return "loginType="+ loginType +",username=" + super.getUsername()+",password="+ String.valueOf(super.getPassword());
    }

}
